package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjSlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjJcEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjSlEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjSlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjSlService")
public class JcAjztTjSlServiceImpl extends ServiceImpl<JcAjztTjSlMapper, JcAjztTjSlEntity> implements JcAjztTjSlService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjSlEntity> infoPage(JcAjztTjSlEntity jcAjztTjSlEntity) {
		Page page = new Page(jcAjztTjSlEntity.getPage(), jcAjztTjSlEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjSlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjSlEntity.getJcry())){
			queryWrapper.eq(JcAjztTjSlEntity::getJcry, jcAjztTjSlEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjSlEntity.getNd())){
			queryWrapper.eq(JcAjztTjSlEntity::getNd, jcAjztTjSlEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjSlEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjSlEntity::getSwjgDm, jcAjztTjSlEntity.getSwjgDm());
		}
		
		
		IPage<JcAjztTjSlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}


}